package com.example.paopao.consumer.account.pojo.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.io.Serializable;


@Data
@Validated
public class UserRegDTO implements Serializable {
    @NotBlank(message = "请提交用户")

    @Pattern(regexp = "^[a-zA-Z]{1}[a-zA-Z0-9_]{2,14}$", message = "用户名必须由4~15长度的字母、数组、下划线组成，且第1个字符必须是字母")
    @ApiModelProperty(value = "用户名", required = true, example = "Lucy")
    private String username;

    @NotBlank(message = "请提有效手机号")
    @Pattern(regexp = "^[0-9]{11}$", message = "手机号格式不正确")
    private String phone;
    @NotBlank(message = "请提交密码")

    @Pattern(regexp = "^.{6,15}$", message = "密码必须是6~15长度的字符组成")
    @ApiModelProperty(value = "密码", required = true, example = "871016")
    private String password;
//    private Date registrationTime;
}
